﻿using System;
using System.Collections.Generic;
using Dexter.Domain.Model;

namespace Dexter.Repository
{
	/// <summary>
	/// 	Rapresents a repository of <see cref="Role"/>.
	/// </summary>
	public interface IRoleRepository : IRepository<Role> {
		/// <summary>
		/// Exists the specified role name.
		/// </summary>
		/// <param name="roleName">Name of the role.</param>
		/// <returns></returns>
		bool RoleExists ( string roleName );

		/// <summary>
		/// Saves the specified role into the repository.
		/// </summary>
		/// <param name="item">The item.</param>
		/// <exception cref="ArgumentNullException"> If <paramref name="item"/> is <c>null</c>.</exception>
		void Save(Role item);

		/// <summary>
		/// Updates the specified role into the repository.
		/// </summary>
		/// <param name="item">The item.</param>
		///<exception cref="ArgumentNullException"> If <paramref name="item"/> is <c>null</c>.</exception>
		void Update(Role item);

		/// <summary>
		/// Deletes the specified role into the repository.
		/// </summary>
		/// <param name="item">The item.</param>
		///<exception cref="ArgumentNullException"> If <paramref name="item"/> is <c>null</c>.</exception>
		void Delete(Role item);

		/// <summary>
		/// Gets the users in role.
		/// </summary>
		/// <param name="roleName">Name of the role.</param>
		/// <returns></returns>
		IEnumerable<User> GetUsersInRole(string roleName);
	}
}